package com.fractalwrench.harmonybootstrap.sample;

import com.beardedhen.harmonybootstrap.utils.ResUtil;
import com.beardedhen.harmonybootstrap.api.attributes.BootstrapBrand;

import ohos.app.Context;

public class CustomBootstrapStyle implements BootstrapBrand {

    private final int defaultFill;
    private final int defaultEdge;
    private final int defaultTextColor;
    private final int activeFill;
    private final int activeEdge;
    private final int activeTextColor;
    private final int disabledFill;
    private final int disabledEdge;
    private final int disabledTextColor;

    @SuppressWarnings("deprecation")
    public CustomBootstrapStyle(Context context) {
        defaultFill = ResUtil.getColor(context,ResourceTable.Color_custom_default_fill);
        defaultEdge = ResUtil.getColor(context,ResourceTable.Color_custom_default_edge);
        defaultTextColor = ResUtil.getColor(context,ResourceTable.Color_white);
        activeFill = ResUtil.getColor(context,ResourceTable.Color_custom_active_fill);
        activeEdge = ResUtil.getColor(context,ResourceTable.Color_custom_active_edge);
        activeTextColor = ResUtil.getColor(context,ResourceTable.Color_black);
        disabledFill = ResUtil.getColor(context,ResourceTable.Color_custom_disabled_fill);
        disabledEdge = ResUtil.getColor(context,ResourceTable.Color_custom_disabled_edge);
        disabledTextColor = ResUtil.getColor(context,ResourceTable.Color_gray);
    }

    @Override public int defaultFill(Context context) {
        return defaultFill;
    }

    @Override public int defaultEdge(Context context) {
        return defaultEdge;
    }

    @Override public int defaultTextColor(Context context) {
        return defaultTextColor;
    }

    @Override public int activeFill(Context context) {
        return activeFill;
    }

    @Override public int activeEdge(Context context) {
        return activeEdge;
    }

    @Override public int activeTextColor(Context context) {
        return activeTextColor;
    }

    @Override public int disabledFill(Context context) {
        return disabledFill;
    }

    @Override public int disabledEdge(Context context) {
        return disabledEdge;
    }

    @Override public int disabledTextColor(Context context) {
        return disabledTextColor;
    }

    @Override public int getColor() {
        return defaultFill;
    }
}
